/**
 * 
 */
package org.istt.service.impl;

import org.istt.dao.FieldDao;
import org.istt.domain.Field;
import org.istt.service.FieldManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Huy
 *
 */
@Service("fieldManager")
public class FieldManagerImpl extends ManagerImpl<Field, Long> implements FieldManager {
	
	/**
	 * @param fieldDao the fieldDao to set
	 */
	@Autowired
	public void setFieldDao(FieldDao dao) {
		this.dao = dao;
	}

	@Override
	public boolean isUnique(String name, Long id) {
		
		return ((FieldDao)dao).isUnique(new String[]{"name"}, new String[]{name}, id);
	}

	@Override
	public Field getFieldByDepartment(Long depID) {
		// TODO Auto-generated method stub
		return ((FieldDao)dao).getFieldByDepartment(depID);
	}	

}
